//
//  ViewController.m
//  IOS01-compute
//
//  Created by RIOS on 2018/3/22.
//  Copyright © 2018年 RIOS. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *text1;
@property (weak, nonatomic) IBOutlet UITextField *text2;
@property (weak, nonatomic) IBOutlet UILabel *result;
- (IBAction)compute:(UIButton *)sender;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)compute:(UIButton *)sender {
    NSLog(@"计算了");
    int num1 = [self.text1.text intValue];
    int num2 = [self.text2.text intValue];
    int rr =num1+num2;
    
    self.result.text = [NSString stringWithFormat:@"%d",rr];
    [self.view endEditing:YES];
}
@end
